home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 49
/
Volume 49 - JOGO DISK .iso
/
Games
/
go_away_fly.swf
/
scripts
/
frame_265
/
DoAction.as
< prev
Wrap
Text File
|
2007-09-27
|
4KB
|
183 lines
function setting_game()
{
pos = random(4);
trace(level + "레벨이양??");
var bug_num = 0;
while(bug_num <= total_num)
{
duplicateMovieClip("bug","bug" + bug_num,16384 + bug_num);
eval("bug" + bug_num).gotoAndStop(2);
trace(eval("position" + (temp_list[bug_num] - 1)));
eval("bug" + bug_num)._x = eval("position" + (temp_list[bug_num] - 1)).Xpos;
eval("bug" + bug_num)._y = eval("position" + (temp_list[bug_num] - 1)).Ypos;
bug_num++;
}
}
function gun_fire()
{
bullet_num++;
attachMovie("bullet","bullet" + bullet_num,bullet_num);
var my_fire = eval("bullet" + bullet_num);
my_fire._x = xpos;
my_fire._y = dooly._y - 65;
my_fire.hit_test = function()
{
this.onEnterFrame = function()
{
this._y -= 30;
if(this._y <= 200)
{
this.onEnterFrame = function()
{
this._y -= 30;
if(this._y <= -10)
{
delete this.onEnterFrame;
this.removeMovieClip();
}
var bug_num = 2 + Number(this._parent.level);
while(bug_num >= 0)
{
var what = eval("this._parent.bug" + bug_num);
if(this.hitTest(what))
{
what.gotoAndStop(4);
what._name = "delete" + what;
this.removeMovieClip();
break;
}
bug_num--;
}
};
}
};
};
my_fire.hit_test();
}
function bug_boom(x2pos, y2pos)
{
bug_bomb++;
attachMovie("bomb","bomb" + bug_bomb,bug_bomb);
var what = eval("bomb" + bug_bomb);
what._x = x2pos;
what._y = y2pos;
what.hit_test = function()
{
this.onEnterFrame = function()
{
this._y += 15;
if(this._y >= 360)
{
this.onEnterFrame = function()
{
this._y += 15;
if(this._y >= 500)
{
delete this.onEnterFrame;
this.removeMovieClip();
}
if(this.hitTest(this._parent.dooly.hitted) && this._parent.key.zState == false)
{
this._parent.dooly.gotoAndStop(3);
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
};
};
what.hit_test();
}
function ai_test(name_s)
{
xpos_sub = random(3);
ypos_sub = random(3);
var bugs_xpos;
var bugs_ypos;
if(xpos_sub == 0)
{
if(name_s._x >= 90)
{
bugs_xpos = name_s._x - 50;
}
else
{
bugs_xpos = name_s._x;
}
}
else if(xpos_sub == 1)
{
bugs_xpos = name_s._x;
}
else if(xpos_sub == 2)
{
if(name_s._x <= 680)
{
bugs_xpos = name_s._x + 50;
}
else
{
bugs_xpos = name_s._x;
}
}
if(ypos_sub == 0)
{
if(name_s._y >= 90)
{
bugs_ypos = name_s._y - 50;
}
else
{
bugs_ypos = name_s._y;
}
}
else if(ypos_sub == 1)
{
bugs_ypos = name_s._y;
}
else if(ypos_sub == 2)
{
if(name_s._y + 50 <= 140)
{
bugs_ypos = name_s._y + 50;
}
else
{
bugs_ypos = name_s._y;
}
}
name_s.onEnterFrame = function()
{
this._x += (bugs_xpos - this._x) / 7;
this._y += (bugs_ypos - this._y) / 7;
if(this._x == bugs_xpos and this._y == bugs_ypos)
{
delete this.onEnterFrame;
}
};
}
function nice_shot()
{
bugs_hits++;
trace(bugs_hits + "마리 전사");
if(bugs_hits == total_num + 1)
{
if(level == 6)
{
play();
}
else
{
gotoAndPlay(264);
}
}
}
var bullet_num = 20;
var xpos;
var ypos;
var bug_bomb = 500;
var bugs_hits = 0;
level_num.gotoAndStop(level + 1);
var total_num = level + 2;
trace(total_num + 1 + "마리들 나와라");